//
// 这里定义一些常用的工具
// Created by Leon Gong on 2022/3/25.
//
#include <bits/stdc++.h>

#ifndef CPPLEARN_U_H
#define CPPLEARN_U_H

#endif //CPPLEARN_U_H

vector<int> RandomVector(int min, int max, int len) {
    vector<int> v;
    srand((unsigned) time(NULL));
    for (int i = 0; i < len; ++i) {
        int n = (rand() % (max - min + 1)) + min;
        v.push_back(n);
    }
    return v;
}

vector<int> ArrayToVector(int arr[], int l) {
    vector<int> ret;

    for (int i = 0; i < l; ++i) {
        ret.push_back(arr[i]);
    }

    return ret;
}

template<class T>
int GetArrayLength(T &arr) {
//    cout << sizeof(arr[0]) << endl;
//    cout << sizeof(arr) << endl;
    return sizeof(arr) / sizeof(arr[0]);
}

template<class T>
void PrintArray(T &arr, int l) {

    for (int i = 0; i < l; i++) {
        cout << arr[i];
        if (i < l - 1) cout << ", ";
    }

    cout << endl;
}

void PrintVector(vector<int> &v) {
    for (vector<int>::iterator it = v.begin(); it < v.end(); it++) {
        cout << *it;
        if (it < v.end() - 1) cout << ", ";
    }
    cout << endl;
}

void CopyVector(vector<int> &x, vector<int> &y) {
    for (int i = 0; i < x.size(); i++) {
        y.push_back(x[i]);
    }
}